package com.icesoft.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.icesoft.framework.core.annotation.Entity;
import com.icesoft.framework.core.data.access.DataAccessCheckpoint;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 系统用户
 *
 * @author ${author}
 * @date 230326
 */
@Getter
@Setter
@TableName("sys_user")
@Accessors(chain = true)
@Entity(module = "system", describe = "系统用户")
public class User extends BaseLoginUser {

	@TableField
	@Column(value = "real_name", comment = "真实姓名", type = MySqlTypeConstant.VARCHAR)
	private String realName;

	@TableField
	@Column(value = "avatar", comment = "头像", type = MySqlTypeConstant.VARCHAR)
	private String avatar;

	@TableField
	@Column(value = "id_card", comment = "身份证号", type = MySqlTypeConstant.VARCHAR)
	private String idCard;

	@TableField
	@Column(value = "sex", comment = "性别", type = MySqlTypeConstant.VARCHAR)
	private String sex;

	@TableField
	@Column(value = "code", comment = "编码", type = MySqlTypeConstant.VARCHAR)
	private String code;

	@TableField
	@Column(value = "user_type", comment = "用户类型", type = MySqlTypeConstant.VARCHAR)
	private String userType;

	@DataAccessCheckpoint()
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	@TableField(fill = FieldFill.INSERT)
	@Column(value = "org_id", comment = "组织机构", length = 40, type = MySqlTypeConstant.BIGINT)
	private Long orgId;

}
